﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _23冒泡排序
{
    class Program
    {
        static void Main(string[] args)
        {
            //冒泡排序
            int[] sum = { 54, 32, 97, 76, 10 };
            for (int i = 0;i<sum.Length-1;i++)
            {
                for (int j = 0;j<sum.Length-1-i;j++)
                {
                    if (sum[j] > sum[j + 1])
                    {
                        int temp = sum[j];
                        sum[j] = sum[j + 1];
                        sum[j + 1] = temp;
                    }
                }
            }
            for (int i =0;i<sum.Length;i++)
            {
                Console.Write(sum[i]+" ");
            }
            Console.ReadLine();
        }
    }
}
